# -*- coding: utf-8 -*-


import requests

url = 'https://httpbin.org/ip'

# 设置代理ip  数据类型是字典  {'协议':'ip:端口'}
proxy = {
    'https':'112.28.228.47:27404'
}
# 175.11.188.22

res = requests.get(url, proxies=proxy)

print(res.text)  # 得到的是外网的ip地址
"""
{"serialNo":"19a04e2a4f7b42f29ccd33ee034616a2","code":0,"data":[{"realIp":"111.27.179.1","pid":5,"cid":23,"area":"吉林-通化","ip":"112.28.228.49","port":34007}]}

{"serialNo":"a678f97cf03745c8bfb2a24840b98c7a","code":0,"data":[{"realIp":"111.27.179.1","pid":5,"cid":23,"area":"吉林-通化","ip":"112.28.228.47","port":27404}]}
"""